<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../lib/bootstrap-3.3.5-dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/index.css">
    <link rel="stylesheet" href="../font/iconfont.css">
    <link rel="stylesheet" href="../css/shouye.css">
    <script src="../lib/bootstrap-3.3.5-dist/js/jquery-1.11.3.js"></script>
    <script src="../lib/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
    <script src="../JavaScript/Highcharts-9.3.2/code/highcharts.js"></script>
    <!-- <script src="../JavaScript/Highcharts-9.3.2/"></script> -->
    <title>Document</title>
</head>

<body>
    <div class="kong11"></div>
    <div id="mulu">
        <p>首页</p>
    </div>
    <div id="con1" class="row">
        <img src="../images/shouye/u295.jpg" alt="" class="col-md-1">
        <div class="col-md-4" id="zao">
            <p>早安，Kevin，祝你开心每一天!</p>
            <p class="smallzi">产品经理│产品研发中心-产品策划部</p>
        </div>
        <div class="col-md-2 col-md-offset-1 you1">
            <p class="smallzi">本月新增用户（人）</p>
            <p id="newuser"></p>
            <div></div>
        </div>
        <div class="col-md-2 you1">
            <p class="smallzi">本月活跃用户（人）</p>
            <p id="actuser"></p>
            <div></div>
        </div>
        <div class="col-md-2 you1">
            <p class="smallzi">累积注册（人）</p>
            <p id="Cumreg"></p>
            <div></div>
        </div>
    </div>
    <div id="con2" class="row">
        <div>
            <p>本月挂号订单（笔）</p>
            <p><span class="iconfont icon-rili"></span><span id="Regorder"></span></p>
            <p><span>月同比<span class="iconfont icon-xiangshang1"></span>12%</span><span>月环比<span
                        class="iconfont icon-xiangxia1"></span>11%</span></p>
        </div>
        <div>
            <p>本月体检套餐销量（套）</p>
            <p><span class="iconfont icon-sharpicons_diagnose-heart"></span><span id="medical"></span></p>
            <p><span>月同比<span class="iconfont icon-xiangshang1"></span>8%</span><span>月环比<span
                        class="iconfont icon-xiangxia1"></span>4%</span></p>
        </div>
        <div>
            <p>本月问诊提问数（个）</p>
            <p><span class="iconfont icon-tingzhenqi"></span><span id="inquiry_num"></span></p>
            <p><span>月同比<span class="iconfont icon-xiangshang1"></span>15%</span><span>月环比<span
                        class="iconfont icon-xiangxia1"></span>10%</span></p>
        </div>
        <div>
            <p>商城累积销售额（元）</p>
            <p><span class="iconfont icon-qian"></span><span id="Mall_fee"></span></p>
            <p><span>月同比<span class="iconfont icon-xiangshang1"></span>17%</span><span>月环比<span
                        class="iconfont icon-xiangshang1"></span>13%</span></p>
        </div>
    </div>
    <div id="con3" class="row">
        <div>
            <p class="biaoti">我的待办</p>
            <div class="col-md-6">
                <p><span class="iconfont icon-tingzhenqi"></span>问诊</p>
                <p><span id="Un_consultations"></span><a href="./Inquiry_order.html">立即处理</a></p>
            </div>
            <div class="col-md-6">
                <p><span class="iconfont icon-sharpicons_diagnose-heart"></span>体检报告</p>
                <p><span id="medical_report"></span><a href="./Inspection_report.html">立即处理</a></p>
            </div>
            <div class="col-md-6">
                <p><span class="iconfont icon-quanbudingdan"></span>订单发货</p>
                <p><span id="delivery_order"></span><a href="./order.html">立即处理</a></p>
            </div>
            <div class="col-md-6">
                <p><span class="iconfont icon-qian1"></span>待处理退款</p>
                <p><span id="Pending_refund"></span><a href="./after_salesData.html">立即处理</a></p>
            </div>
            <div class="col-md-6">
                <p><span class="iconfont icon-24gl-box2"></span>待处理退货</p>
                <p><span id="Return_pending"></span><a href="./after_salesData.html">立即处理</a></p>
            </div>
            <div class="col-md-6">
                <p><span class="iconfont icon-lin-exchangeboxzhuanhuanfangxing"></span>待处理换货</p>
                <p><span id="processed"></span><a href="./after_salesData.html">立即处理</a></p>
            </div>
        </div>
        <div>
            <p class="biaoti">快捷入口</p>
            <p><span class="iconfont icon-jigou"></span><a href="">添加机构</a></p>
            <p><span class="iconfont icon-yuyueguahao"></span><a href="./Registered_order.html">挂号订单</a></p>
            <p><span class="iconfont icon-tingzhenqi"></span><a href="">添加套餐</a></p>
            <p><span class="iconfont icon-dingdan1"></span><a href="./Inspection_report.html">体检订单</a></p>
            <p><span class="iconfont icon-yiyuan1"></span><a href="">添加医院</a></p>
            <p><span class="iconfont icon-dingdan"></span><a href="./Inquiry_order.html">问诊订单</a></p>
            <p><span class="iconfont icon-keshiguanli"></span><a href="./Department.html">添加科室</a></p>
            <p><span class="iconfont icon-74wodedingdan"></span><a href="./order.html">商城订单</a></p>
            <p><span class="iconfont icon-jibingguanli"></span><a href="./disease.html">添加疾病</a></p>
            <p><span class="iconfont icon-gouwu"></span><a href="">添加商品</a></p>
            <p><span class="iconfont icon-yisheng"></span><a href="">添加医生</a></p>
            <p><span class="iconfont icon-zixun"></span><a href="">添加咨询</a></p>
        </div>
    </div>
    <div id="con4" class="row">
        <div id="movement">
            <p class="biaoti">本周运动达人</p>

        </div>
        <div id="lose_weight">
            <p class="biaoti">本周减肥明星</p>
        </div>
    </div>
    <div id="con5" class="row">
    </div>
    <div id="con6" class="row">
    </div>
    <div class="conce">
        <div>
            <p>挂号订单</p>
            <p><span>124</span>笔</p>
            <p>较上周<span class="iconfont icon-shuzhishangsheng"></span>22%</p>
        </div>
        <div>
            <p>体检订单</p>
            <p><span>125</span>笔</p>
            <p>较上周<span class="iconfont icon-shuzhishangsheng"></span>14%</p>
        </div>
        <div>
            <p>提问订单</p>
            <p><span>109</span>笔</p>
            <p>较上周<span class="iconfont icon-shuzhixiajiang"></span>5%</p>
        </div>
    </div>
    <div class="conce conce2">
        <div>
            <p>挂号销售额</p>
            <p><span>14450</span>元</p>
            <p>较上周<span class="iconfont icon-shuzhishangsheng"></span>18%</p>
        </div>
        <div>
            <p>体检销售额</p>
            <p><span>12600</span>元</p>
            <p>较上周<span class="iconfont icon-shuzhishangsheng"></span>16%</p>
        </div>
        <div>
            <p>提问销售额</p>
            <p><span>12050</span>元</p>
            <p>较上周<span class="iconfont icon-shuzhixiajiang"></span>2%</p>
        </div>
    </div>
    <div class="col-md-12">
        <span class="foot1">大健康综合管理后台</span>
        <span class="foot2">版权所有:@大健康综合(集团)有限公司Meinian Onehealth Healthcare (Group)Co.</span>
        <span class="foot2">沪ICP备09017846号-3沪公网安备31010602006448号</span>
    </div>

    <script src="../JavaScript/index.js"></script>
    <script src="../JavaScript/data.js"></script>
    <script src="../JavaScript/utils.js"></script>
    <script>
        let newuser_num = 0
        $.each(userData, function (index, item) {
            if (item.recordDate.substring(0, 4) == '2021') {
                if (item.recordDate.substring(5, 7) == '08') {
                    newuser_num++
                }
            }
        })
        $('#newuser').text(`${newuser_num}`)
        let actuser_num = 0
        let newInquiry = getset(Inquiry, 'Inquiry')
        let Un_consultations_num = 0
        $.each(newInquiry, function (index, item) {
            if (item.quiz.substring(0, 4) == '2020') {
                if (item.quiz.substring(5, 7) == '03') {
                    actuser_num++
                }
            }
            if (item.state == '待回答') {
                Un_consultations_num++
            }
        })
        $('#Un_consultations').text(`你有${Un_consultations_num}个待处理的提问`)
        $('#actuser').text(`${actuser_num}`)
        $("#Cumreg").text(`${userData.length}`)
        $('#Regorder').text(`${inspect.length}`)
        $('#medical').text(`${report.length}`)
        $('#inquiry_num').text(`${Inquiry.length}`)
        let Mall_fee = 0
        $.each(orderData, function (index, item) {
            if (orderData.orderMethod != '未支付') {
                Mall_fee += parseInt(item.goodsPrice)
            }
        })
        $('#Mall_fee').text(`${Mall_fee}`)
        function num(val, data) {//数据的属性的值，数据的来源
            let sum = 0
            data.forEach(item => {
                for (var i in item) {
                    if (item[i] == val)
                        sum++
                }
            })
            return sum
        }
        let newreport = getset(report, 'report')
        let neworderData = getset(orderData, 'orderData')
        let newafter_salesData = getset(after_salesData, 'after_salesData')
        $('#medical_report').text(`你有${num('', newreport)}份体检报告未上传`)
        $('#delivery_order').text(`你有${num('待发货', neworderData)}笔订单待发货`)
        $('#Pending_refund').text(`你有${num('待处理', newafter_salesData)}笔退款待处理`)
        $('#Return_pending').text(`你有${num('待处理', newafter_salesData)}笔退款待处理`)
        $('#processed').text(`你有${num('待处理', newafter_salesData)}笔换货待处理`)
        var compare = function (prop) {
            return function (obj1, obj2) {
                var val1 = obj1[prop];
                var val2 = obj2[prop];
                if (!isNaN(Number(val1)) && !isNaN(Number(val2))) {
                    val1 = Number(val1);
                    val2 = Number(val2);
                }
                if (val1 > val2) {
                    return -1;
                } else if (val1 < val2) {
                    return 1;
                } else {
                    return 0;
                }
            }
        }
        let steppaixu = queryData.sort(compare('stepNum'))
        $('#movement').append(` <p class='col-md-6'><span class="iconfont icon-jiangbei"></span> <img src="../images/shouye/u295.jpg" alt=""><span>${steppaixu[0].userName}</span><span>${steppaixu[0].stepNum}步</span></p>`)
        $('#movement').append(` <p class='col-md-6'><span class="iconfont icon-jiangbei1"></span> <img src="../images/shouye/u295.jpg" alt=""><span>${steppaixu[1].userName}</span><span>${steppaixu[1].stepNum}步</span></p>`)
        $('#movement').append(` <p class='col-md-6'><span class="iconfont icon-jiangbei2"></span> <img src="../images/shouye/u295.jpg" alt=""><span>${steppaixu[2].userName}</span><span>${steppaixu[2].stepNum}步</span></p>`)
        for (var i = 4; i < 11; i++) {
            $('#movement').append(` <p class='col-md-6'><span >${i}</span><img src="../images/shouye/u295.jpg" alt=""><span>${steppaixu[i].userName}</span><span>${steppaixu[i].stepNum}步</span></p>`)
        }
        let loseweight = queryData.sort(compare('fatRate'))
        $('#lose_weight').append(` <p class='col-md-6'><span class="iconfont icon-jiangbei"></span> <img src="../images/shouye/u295.jpg" alt=""><span>${loseweight[0].userName}</span><span>${-5.2}公斤</span></p>`)
        $('#lose_weight').append(` <p class='col-md-6'><span class="iconfont icon-jiangbei1"></span> <img src="../images/shouye/u295.jpg" alt=""><span>${loseweight[1].userName}</span><span>${-5.0}公斤</span></p>`)
        $('#lose_weight').append(` <p class='col-md-6'><span class="iconfont icon-jiangbei2"></span> <img src="../images/shouye/u295.jpg" alt=""><span>${loseweight[2].userName}</span><span>${-4.8}公斤</span></p>`)
        for (var i = 4; i < 11; i++) {
            $('#lose_weight').append(` <p class='col-md-6'><span >${i}</span><img src="../images/shouye/u295.jpg" alt=""><span>${loseweight[i].userName}</span><span>${-loseweight[i].fatRate / 10}公斤</span></p>`)
        }
        $(function () {
            $('#con5').highcharts({
                colors: ['#1890FF', '#2FC25B', '#FACC14'],
                chart: {
                    type: 'column'
                },
                title: {
                    text: '本周医疗订单'
                },
                xAxis: {
                    categories: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天']
                },
                credits: {
                    enabled: true
                },
                series: [{
                    name: '挂号订单',
                    data: [10, 15, 10, 20, 30, 13, 26]
                }, {
                    name: '体检订单',
                    data: [13, 10, 14, 17, 33, 11, 27]
                },
                {
                    name: '提问订单',
                    data: [14, 22, 13, 23, 10, 11, 16]
                }
                ]
            });
        });
        $(function () {
            $('#con6').highcharts({
                colors: ['#F04864', '#8543E0', '#13C2C2'],
                chart: {
                    type: 'column'
                },
                title: {
                    text: '本商城销售页面'
                },
                xAxis: {
                    categories: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天']
                },
                credits: {
                    enabled: true
                },
                series: [{
                    name: '挂号销售额',
                    data: [3400, 1500, 1000, 2050, 3100, 1400, 2000]
                }, {
                    name: '体检销售额',
                    data: [1300, 1000, 1460, 1740, 3300, 1100, 2700]
                },
                {
                    name: '提问销售额',
                    data: [1400, 2200, 1300, 2300, 1700, 1160, 1990]
                }
                ]
            });
        });
        $('#zao p:nth-of-type(1)').text(`早安，${myuser[0].nickName}，祝你开心每一天!`)
    </script>
</body>

</html>